<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TurboJPEG: TurboJPEG</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">TurboJPEG
   &#160;<span id="projectnumber">3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">TurboJPEG</div>  </div>
</div><!--header-->
<div class="contents">

<p>TurboJPEG API.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scaling factor.  <a href="structtjscalingfactor.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtjregion.html">tjregion</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cropping region.  <a href="structtjregion.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html">tjtransform</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lossless transform.  <a href="structtjtransform.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga5e0e8c784295c636f0bf8dab93c4bddf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga5e0e8c784295c636f0bf8dab93c4bddf">TJ_NUMINIT</a></td></tr>
<tr class="memdesc:ga5e0e8c784295c636f0bf8dab93c4bddf"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of initialization options.  <a href="group___turbo_j_p_e_g.html#ga5e0e8c784295c636f0bf8dab93c4bddf">More...</a><br /></td></tr>
<tr class="separator:ga5e0e8c784295c636f0bf8dab93c4bddf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ef3d169162ce77ce348e292a0b7477c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a></td></tr>
<tr class="memdesc:ga5ef3d169162ce77ce348e292a0b7477c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of chrominance subsampling options.  <a href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">More...</a><br /></td></tr>
<tr class="separator:ga5ef3d169162ce77ce348e292a0b7477c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7010a4402f54a45ba822ad8675a4655e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a></td></tr>
<tr class="memdesc:ga7010a4402f54a45ba822ad8675a4655e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of pixel formats.  <a href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">More...</a><br /></td></tr>
<tr class="separator:ga7010a4402f54a45ba822ad8675a4655e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71">TJ_NUMCS</a></td></tr>
<tr class="memdesc:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of JPEG colorspaces.  <a href="group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71">More...</a><br /></td></tr>
<tr class="separator:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa628be5db276fc3676dfba205d45d780"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa628be5db276fc3676dfba205d45d780">TJ_NUMPARAM</a></td></tr>
<tr class="memdesc:gaa628be5db276fc3676dfba205d45d780"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of parameters.  <a href="group___turbo_j_p_e_g.html#gaa628be5db276fc3676dfba205d45d780">More...</a><br /></td></tr>
<tr class="separator:gaa628be5db276fc3676dfba205d45d780"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga79bde1b4a3e2351e00887e47781b966e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga79bde1b4a3e2351e00887e47781b966e">TJ_NUMERR</a></td></tr>
<tr class="memdesc:ga79bde1b4a3e2351e00887e47781b966e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of error codes.  <a href="group___turbo_j_p_e_g.html#ga79bde1b4a3e2351e00887e47781b966e">More...</a><br /></td></tr>
<tr class="separator:ga79bde1b4a3e2351e00887e47781b966e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c">TJ_NUMXOP</a></td></tr>
<tr class="memdesc:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of transform operations.  <a href="group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c">More...</a><br /></td></tr>
<tr class="separator:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50e03cb5ed115330e212417429600b00"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">TJXOPT_PERFECT</a></td></tr>
<tr class="memdesc:ga50e03cb5ed115330e212417429600b00"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect.  <a href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">More...</a><br /></td></tr>
<tr class="separator:ga50e03cb5ed115330e212417429600b00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga319826b7eb1583c0595bbe7b95428709"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709">TJXOPT_TRIM</a></td></tr>
<tr class="memdesc:ga319826b7eb1583c0595bbe7b95428709"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to discard any partial MCU blocks that cannot be transformed.  <a href="group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709">More...</a><br /></td></tr>
<tr class="separator:ga319826b7eb1583c0595bbe7b95428709"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9c771a757fc1294add611906b89ab2d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">TJXOPT_CROP</a></td></tr>
<tr class="memdesc:ga9c771a757fc1294add611906b89ab2d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable lossless cropping.  <a href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">More...</a><br /></td></tr>
<tr class="separator:ga9c771a757fc1294add611906b89ab2d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3acee7b48ade1b99e5588736007c2589"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589">TJXOPT_GRAY</a></td></tr>
<tr class="memdesc:ga3acee7b48ade1b99e5588736007c2589"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will discard the color data in the source image and produce a grayscale destination image.  <a href="group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589">More...</a><br /></td></tr>
<tr class="separator:ga3acee7b48ade1b99e5588736007c2589"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafbf992bbf6e006705886333703ffab31"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">TJXOPT_NOOUTPUT</a></td></tr>
<tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from outputting a JPEG image for this particular transform.  <a href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">More...</a><br /></td></tr>
<tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad2371c80674584ecc1a7d75e564cf026"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026">TJXOPT_PROGRESSIVE</a></td></tr>
<tr class="memdesc:gad2371c80674584ecc1a7d75e564cf026"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable progressive entropy coding in the JPEG image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026">More...</a><br /></td></tr>
<tr class="separator:gad2371c80674584ecc1a7d75e564cf026"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga153b468cfb905d0de61706c838986fe8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8">TJXOPT_COPYNONE</a></td></tr>
<tr class="memdesc:ga153b468cfb905d0de61706c838986fe8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image.  <a href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8">More...</a><br /></td></tr>
<tr class="separator:ga153b468cfb905d0de61706c838986fe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecaaa3b7e2af812592c015d83207f010"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010">TJXOPT_ARITHMETIC</a></td></tr>
<tr class="memdesc:gaecaaa3b7e2af812592c015d83207f010"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010">More...</a><br /></td></tr>
<tr class="separator:gaecaaa3b7e2af812592c015d83207f010"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117">TJXOPT_OPTIMIZE</a></td></tr>
<tr class="memdesc:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117">More...</a><br /></td></tr>
<tr class="separator:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84878bb65404204743aa18cac02781df"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df">TJSCALED</a>(dimension,  scalingFactor)</td></tr>
<tr class="memdesc:ga84878bb65404204743aa18cac02781df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the scaled value of <code>dimension</code> using the given scaling factor.  <a href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df">More...</a><br /></td></tr>
<tr class="separator:ga84878bb65404204743aa18cac02781df"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga504805ec0161f1b505397ca0118bf8fd"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structtjtransform.html">tjtransform</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd">tjtransform</a></td></tr>
<tr class="memdesc:ga504805ec0161f1b505397ca0118bf8fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lossless transform.  <a href="group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd">More...</a><br /></td></tr>
<tr class="separator:ga504805ec0161f1b505397ca0118bf8fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga758d2634ecb4949de7815cba621f5763"><td class="memItemLeft" align="right" valign="top">typedef void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a></td></tr>
<tr class="memdesc:ga758d2634ecb4949de7815cba621f5763"><td class="mdescLeft">&#160;</td><td class="mdescRight">TurboJPEG instance handle.  <a href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">More...</a><br /></td></tr>
<tr class="separator:ga758d2634ecb4949de7815cba621f5763"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga3850bbee1313e752e667b4eb08b1e086"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">TJINIT</a> { <a class="el" href="group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086aa45ac279e3dc6ffabc4b0f45864da796">TJINIT_COMPRESS</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a4b8ca1ef700699b71350700bf95c2167">TJINIT_DECOMPRESS</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a8d58a2a4c45b3e0cd349746544a6e0c2">TJINIT_TRANSFORM</a>
 }</td></tr>
<tr class="memdesc:ga3850bbee1313e752e667b4eb08b1e086"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization options.  <a href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">More...</a><br /></td></tr>
<tr class="separator:ga3850bbee1313e752e667b4eb08b1e086"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1d047060ea80bb9820d540bb928e9074"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">TJSAMP</a> { <br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3">TJSAMP_444</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404">TJSAMP_422</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248">TJSAMP_GRAY</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974">TJSAMP_440</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2">TJSAMP_411</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d">TJSAMP_441</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173">TJSAMP_UNKNOWN</a>
<br />
 }</td></tr>
<tr class="memdesc:ga1d047060ea80bb9820d540bb928e9074"><td class="mdescLeft">&#160;</td><td class="mdescRight">Chrominance subsampling options.  <a href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">More...</a><br /></td></tr>
<tr class="separator:ga1d047060ea80bb9820d540bb928e9074"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac916144e26c3817ac514e64ae5d12e2a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">TJPF</a> { <br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c">TJPF_RGB</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839">TJPF_BGR</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12">TJPF_RGBA</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4">TJPF_BGRA</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081">TJPF_ABGR</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c">TJPF_ARGB</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a>
<br />
 }</td></tr>
<tr class="memdesc:gac916144e26c3817ac514e64ae5d12e2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel formats.  <a href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">More...</a><br /></td></tr>
<tr class="separator:gac916144e26c3817ac514e64ae5d12e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">TJCS</a> { <br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555">TJCS_RGB</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75">TJCS_YCbCr</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a">TJCS_GRAY</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53">TJCS_CMYK</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e">TJCS_YCCK</a>
<br />
 }</td></tr>
<tr class="memdesc:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="mdescLeft">&#160;</td><td class="mdescRight">JPEG colorspaces.  <a href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">More...</a><br /></td></tr>
<tr class="separator:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa0f6be63ba78278299c9f5c12031fe82"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">TJPARAM</a> { <br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a555e2212079fa49b30bcd2879c6c8ddb">TJPARAM_STOPONWARNING</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a924657172695ed6cb0b128219546fcce">TJPARAM_BOTTOMUP</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b">TJPARAM_NOREALLOC</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0467e8792621f2d817dc2af563d3186c">TJPARAM_QUALITY</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a">TJPARAM_SUBSAMP</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8">TJPARAM_JPEGWIDTH</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f">TJPARAM_JPEGHEIGHT</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8">TJPARAM_PRECISION</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c">TJPARAM_COLORSPACE</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0">TJPARAM_FASTUPSAMPLE</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627">TJPARAM_FASTDCT</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6">TJPARAM_OPTIMIZE</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f">TJPARAM_PROGRESSIVE</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167">TJPARAM_SCANLIMIT</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7">TJPARAM_ARITHMETIC</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f">TJPARAM_LOSSLESS</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159">TJPARAM_LOSSLESSPSV</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a">TJPARAM_LOSSLESSPT</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec">TJPARAM_RESTARTBLOCKS</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c">TJPARAM_RESTARTROWS</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877">TJPARAM_XDENSITY</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba">TJPARAM_YDENSITY</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4c045981bd8a303521a401dbbe1df208">TJPARAM_DENSITYUNITS</a>
<br />
 }</td></tr>
<tr class="memdesc:gaa0f6be63ba78278299c9f5c12031fe82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parameters.  <a href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">More...</a><br /></td></tr>
<tr class="separator:gaa0f6be63ba78278299c9f5c12031fe82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">TJERR</a> { <a class="el" href="group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950fea342dd6e2aedb47bb257b4e7568329b59">TJERR_WARNING</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a">TJERR_FATAL</a>
 }</td></tr>
<tr class="memdesc:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error codes.  <a href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">More...</a><br /></td></tr>
<tr class="separator:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2de531af4e7e6c4f124908376b354866"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">TJXOP</a> { <br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27">TJXOP_NONE</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce">TJXOP_HFLIP</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d">TJXOP_VFLIP</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d">TJXOP_TRANSPOSE</a>, 
<br />
&#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4">TJXOP_TRANSVERSE</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128">TJXOP_ROT90</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692">TJXOP_ROT180</a>, 
<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08">TJXOP_ROT270</a>
<br />
 }</td></tr>
<tr class="memdesc:ga2de531af4e7e6c4f124908376b354866"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a>  <a href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">More...</a><br /></td></tr>
<tr class="separator:ga2de531af4e7e6c4f124908376b354866"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga69c09d39f97ec30250ad3605ace7e5df"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga69c09d39f97ec30250ad3605ace7e5df">tj3Init</a> (int initType)</td></tr>
<tr class="memdesc:ga69c09d39f97ec30250ad3605ace7e5df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new TurboJPEG instance.  <a href="group___turbo_j_p_e_g.html#ga69c09d39f97ec30250ad3605ace7e5df">More...</a><br /></td></tr>
<tr class="separator:ga69c09d39f97ec30250ad3605ace7e5df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaddf92640bfee3e8622218c713e77e7db"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaddf92640bfee3e8622218c713e77e7db">tj3Set</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, int param, int value)</td></tr>
<tr class="memdesc:gaddf92640bfee3e8622218c713e77e7db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value of a parameter.  <a href="group___turbo_j_p_e_g.html#gaddf92640bfee3e8622218c713e77e7db">More...</a><br /></td></tr>
<tr class="separator:gaddf92640bfee3e8622218c713e77e7db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga34af9ba3183bdf0ec7c8f47bb9a4c84f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga34af9ba3183bdf0ec7c8f47bb9a4c84f">tj3Get</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, int param)</td></tr>
<tr class="memdesc:ga34af9ba3183bdf0ec7c8f47bb9a4c84f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the value of a parameter.  <a href="group___turbo_j_p_e_g.html#ga34af9ba3183bdf0ec7c8f47bb9a4c84f">More...</a><br /></td></tr>
<tr class="separator:ga34af9ba3183bdf0ec7c8f47bb9a4c84f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2cc418a2dab709ad7f30f5b25905f138"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2cc418a2dab709ad7f30f5b25905f138">tj3Compress8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
<tr class="memdesc:ga2cc418a2dab709ad7f30f5b25905f138"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into an 8-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#ga2cc418a2dab709ad7f30f5b25905f138">More...</a><br /></td></tr>
<tr class="separator:ga2cc418a2dab709ad7f30f5b25905f138"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a1968c384ec7abb6122830253ebf570"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9a1968c384ec7abb6122830253ebf570">tj3Compress12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const short *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
<tr class="memdesc:ga9a1968c384ec7abb6122830253ebf570"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 12-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#ga9a1968c384ec7abb6122830253ebf570">More...</a><br /></td></tr>
<tr class="separator:ga9a1968c384ec7abb6122830253ebf570"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77901b71d0471784f318ada31ff4e7bd"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga77901b71d0471784f318ada31ff4e7bd">tj3Compress16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned short *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
<tr class="memdesc:ga77901b71d0471784f318ada31ff4e7bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 16-bit-per-sample lossless JPEG image.  <a href="group___turbo_j_p_e_g.html#ga77901b71d0471784f318ada31ff4e7bd">More...</a><br /></td></tr>
<tr class="separator:ga77901b71d0471784f318ada31ff4e7bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga041c870d9c669eb3f385c78f4346c43f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga041c870d9c669eb3f385c78f4346c43f">tj3CompressFromYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int align, int height, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
<tr class="memdesc:ga041c870d9c669eb3f385c78f4346c43f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#ga041c870d9c669eb3f385c78f4346c43f">More...</a><br /></td></tr>
<tr class="separator:ga041c870d9c669eb3f385c78f4346c43f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac9f5ace3e73805b476c95dda9f8d0cd0"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac9f5ace3e73805b476c95dda9f8d0cd0">tj3CompressFromYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *const *srcPlanes, int width, const int *strides, int height, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
<tr class="memdesc:gac9f5ace3e73805b476c95dda9f8d0cd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#gac9f5ace3e73805b476c95dda9f8d0cd0">More...</a><br /></td></tr>
<tr class="separator:gac9f5ace3e73805b476c95dda9f8d0cd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac6285e58e35a35d871d7162ec5a929c4"><td class="memItemLeft" align="right" valign="top">DLLEXPORT size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4">tj3JPEGBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
<tr class="memdesc:gac6285e58e35a35d871d7162ec5a929c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.  <a href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4">More...</a><br /></td></tr>
<tr class="separator:gac6285e58e35a35d871d7162ec5a929c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaebaa16973a0f550a66eca5765ed0546"><td class="memItemLeft" align="right" valign="top">DLLEXPORT size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546">tj3YUVBufSize</a> (int width, int align, int height, int subsamp)</td></tr>
<tr class="memdesc:gaaebaa16973a0f550a66eca5765ed0546"><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the buffer (in bytes) required to hold a unified planar YUV image with the given parameters.  <a href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546">More...</a><br /></td></tr>
<tr class="separator:gaaebaa16973a0f550a66eca5765ed0546"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacc19d265edce76b46146f59579f9438d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d">tj3YUVPlaneSize</a> (int componentID, int width, int stride, int height, int subsamp)</td></tr>
<tr class="memdesc:gacc19d265edce76b46146f59579f9438d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.  <a href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d">More...</a><br /></td></tr>
<tr class="separator:gacc19d265edce76b46146f59579f9438d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac99d1933ede1d59fcada9a826e88eb2d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac99d1933ede1d59fcada9a826e88eb2d">tj3YUVPlaneWidth</a> (int componentID, int width, int subsamp)</td></tr>
<tr class="memdesc:gac99d1933ede1d59fcada9a826e88eb2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The plane width of a YUV image plane with the given parameters.  <a href="group___turbo_j_p_e_g.html#gac99d1933ede1d59fcada9a826e88eb2d">More...</a><br /></td></tr>
<tr class="separator:gac99d1933ede1d59fcada9a826e88eb2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga969767ec8180cc3edd99cf507f87299b"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga969767ec8180cc3edd99cf507f87299b">tj3YUVPlaneHeight</a> (int componentID, int height, int subsamp)</td></tr>
<tr class="memdesc:ga969767ec8180cc3edd99cf507f87299b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The plane height of a YUV image plane with the given parameters.  <a href="group___turbo_j_p_e_g.html#ga969767ec8180cc3edd99cf507f87299b">More...</a><br /></td></tr>
<tr class="separator:ga969767ec8180cc3edd99cf507f87299b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2a8d50f130bde10f0a04030f8cc59936"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2a8d50f130bde10f0a04030f8cc59936">tj3EncodeYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int align)</td></tr>
<tr class="memdesc:ga2a8d50f130bde10f0a04030f8cc59936"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into an 8-bit-per-sample unified planar YUV image.  <a href="group___turbo_j_p_e_g.html#ga2a8d50f130bde10f0a04030f8cc59936">More...</a><br /></td></tr>
<tr class="separator:ga2a8d50f130bde10f0a04030f8cc59936"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2e9df38790e9bddc249d04cb158a4cf"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae2e9df38790e9bddc249d04cb158a4cf">tj3EncodeYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides)</td></tr>
<tr class="memdesc:gae2e9df38790e9bddc249d04cb158a4cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes.  <a href="group___turbo_j_p_e_g.html#gae2e9df38790e9bddc249d04cb158a4cf">More...</a><br /></td></tr>
<tr class="separator:gae2e9df38790e9bddc249d04cb158a4cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga96d2c4b3432f9d88ad14758ae240b8d1"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1">tj3DecompressHeader</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize)</td></tr>
<tr class="memdesc:ga96d2c4b3432f9d88ad14758ae240b8d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quantization and Huffman tables.  <a href="group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1">More...</a><br /></td></tr>
<tr class="separator:ga96d2c4b3432f9d88ad14758ae240b8d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga74397f8e0587d4233182c72f085aaf04"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga74397f8e0587d4233182c72f085aaf04">tj3GetScalingFactors</a> (int *numScalingFactors)</td></tr>
<tr class="memdesc:ga74397f8e0587d4233182c72f085aaf04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a list of fractional scaling factors that the JPEG decompressor supports.  <a href="group___turbo_j_p_e_g.html#ga74397f8e0587d4233182c72f085aaf04">More...</a><br /></td></tr>
<tr class="separator:ga74397f8e0587d4233182c72f085aaf04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga89da17ee1e43ff423382cbc145803c75"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75">tj3SetScalingFactor</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> scalingFactor)</td></tr>
<tr class="memdesc:ga89da17ee1e43ff423382cbc145803c75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the scaling factor for subsequent lossy decompression operations.  <a href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75">More...</a><br /></td></tr>
<tr class="separator:ga89da17ee1e43ff423382cbc145803c75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa49c7bd4c9431667a043cfc93388ba1c"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c">tj3SetCroppingRegion</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, <a class="el" href="structtjregion.html">tjregion</a> croppingRegion)</td></tr>
<tr class="memdesc:gaa49c7bd4c9431667a043cfc93388ba1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.  <a href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c">More...</a><br /></td></tr>
<tr class="separator:gaa49c7bd4c9431667a043cfc93388ba1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1169c7c1a26ec18c9e6122cb8ae64013"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1169c7c1a26ec18c9e6122cb8ae64013">tj3Decompress8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned char *dstBuf, int pitch, int pixelFormat)</td></tr>
<tr class="memdesc:ga1169c7c1a26ec18c9e6122cb8ae64013"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#ga1169c7c1a26ec18c9e6122cb8ae64013">More...</a><br /></td></tr>
<tr class="separator:ga1169c7c1a26ec18c9e6122cb8ae64013"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga39b848f01781ad74a5b3941c012b6199"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga39b848f01781ad74a5b3941c012b6199">tj3Decompress12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, short *dstBuf, int pitch, int pixelFormat)</td></tr>
<tr class="memdesc:ga39b848f01781ad74a5b3941c012b6199"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a 12-bit-per-sample JPEG image into a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#ga39b848f01781ad74a5b3941c012b6199">More...</a><br /></td></tr>
<tr class="separator:ga39b848f01781ad74a5b3941c012b6199"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa074e63f9beb0b3ff42b833a4049df6e"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa074e63f9beb0b3ff42b833a4049df6e">tj3Decompress16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned short *dstBuf, int pitch, int pixelFormat)</td></tr>
<tr class="memdesc:gaa074e63f9beb0b3ff42b833a4049df6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a 16-bit-per-sample lossless JPEG image into a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#gaa074e63f9beb0b3ff42b833a4049df6e">More...</a><br /></td></tr>
<tr class="separator:gaa074e63f9beb0b3ff42b833a4049df6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e6bf6a19fec3f9fa7534348879d8320"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1e6bf6a19fec3f9fa7534348879d8320">tj3DecompressToYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned char *dstBuf, int align)</td></tr>
<tr class="memdesc:ga1e6bf6a19fec3f9fa7534348879d8320"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample unified planar YUV image.  <a href="group___turbo_j_p_e_g.html#ga1e6bf6a19fec3f9fa7534348879d8320">More...</a><br /></td></tr>
<tr class="separator:ga1e6bf6a19fec3f9fa7534348879d8320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga934373482dbbf257f2280505b6ff4fb5"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga934373482dbbf257f2280505b6ff4fb5">tj3DecompressToYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned char **dstPlanes, int *strides)</td></tr>
<tr class="memdesc:ga934373482dbbf257f2280505b6ff4fb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress an 8-bit-per-sample JPEG image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes.  <a href="group___turbo_j_p_e_g.html#ga934373482dbbf257f2280505b6ff4fb5">More...</a><br /></td></tr>
<tr class="separator:ga934373482dbbf257f2280505b6ff4fb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1eb574f38b1c1de43a6c7aafcf68d8c"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa1eb574f38b1c1de43a6c7aafcf68d8c">tj3DecodeYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int align, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat)</td></tr>
<tr class="memdesc:gaa1eb574f38b1c1de43a6c7aafcf68d8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample packed-pixel RGB or grayscale image.  <a href="group___turbo_j_p_e_g.html#gaa1eb574f38b1c1de43a6c7aafcf68d8c">More...</a><br /></td></tr>
<tr class="separator:gaa1eb574f38b1c1de43a6c7aafcf68d8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad366f1915f82c1ad4e7e37ebe073ca89"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad366f1915f82c1ad4e7e37ebe073ca89">tj3DecodeYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *const *srcPlanes, const int *strides, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat)</td></tr>
<tr class="memdesc:gad366f1915f82c1ad4e7e37ebe073ca89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample packed-pixel RGB or grayscale image.  <a href="group___turbo_j_p_e_g.html#gad366f1915f82c1ad4e7e37ebe073ca89">More...</a><br /></td></tr>
<tr class="separator:gad366f1915f82c1ad4e7e37ebe073ca89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff23ba1dcabed456794b844791613920"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920">tj3Transform</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, int n, unsigned char **dstBufs, size_t *dstSizes, const <a class="el" href="structtjtransform.html">tjtransform</a> *transforms)</td></tr>
<tr class="memdesc:gaff23ba1dcabed456794b844791613920"><td class="mdescLeft">&#160;</td><td class="mdescRight">Losslessly transform a JPEG image into another JPEG image.  <a href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920">More...</a><br /></td></tr>
<tr class="separator:gaff23ba1dcabed456794b844791613920"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga53fbadf4560e95a65b8f5ab81703fe82"><td class="memItemLeft" align="right" valign="top">DLLEXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga53fbadf4560e95a65b8f5ab81703fe82">tj3Destroy</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
<tr class="memdesc:ga53fbadf4560e95a65b8f5ab81703fe82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a TurboJPEG instance.  <a href="group___turbo_j_p_e_g.html#ga53fbadf4560e95a65b8f5ab81703fe82">More...</a><br /></td></tr>
<tr class="separator:ga53fbadf4560e95a65b8f5ab81703fe82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab40a0b231122f536e503e3394569a68d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d">tj3Alloc</a> (size_t bytes)</td></tr>
<tr class="memdesc:gab40a0b231122f536e503e3394569a68d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a byte buffer for use with TurboJPEG.  <a href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d">More...</a><br /></td></tr>
<tr class="separator:gab40a0b231122f536e503e3394569a68d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga565aaae7be3f8ca9099b56655c893251"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251">tj3LoadImage8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, int *width, int align, int *height, int *pixelFormat)</td></tr>
<tr class="memdesc:ga565aaae7be3f8ca9099b56655c893251"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load an 8-bit-per-sample packed-pixel image from disk into memory.  <a href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251">More...</a><br /></td></tr>
<tr class="separator:ga565aaae7be3f8ca9099b56655c893251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f03c26892a26d4ce077ed6a4ac40e8f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT short *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1f03c26892a26d4ce077ed6a4ac40e8f">tj3LoadImage12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, int *width, int align, int *height, int *pixelFormat)</td></tr>
<tr class="memdesc:ga1f03c26892a26d4ce077ed6a4ac40e8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a 12-bit-per-sample packed-pixel image from disk into memory.  <a href="group___turbo_j_p_e_g.html#ga1f03c26892a26d4ce077ed6a4ac40e8f">More...</a><br /></td></tr>
<tr class="separator:ga1f03c26892a26d4ce077ed6a4ac40e8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga638aeba63e0ccb89d472fdbf34224cfc"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned short *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga638aeba63e0ccb89d472fdbf34224cfc">tj3LoadImage16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, int *width, int align, int *height, int *pixelFormat)</td></tr>
<tr class="memdesc:ga638aeba63e0ccb89d472fdbf34224cfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a 16-bit-per-sample packed-pixel image from disk into memory.  <a href="group___turbo_j_p_e_g.html#ga638aeba63e0ccb89d472fdbf34224cfc">More...</a><br /></td></tr>
<tr class="separator:ga638aeba63e0ccb89d472fdbf34224cfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa4ec838988e469cc15618e4690cc8722"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722">tj3SaveImage8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, const unsigned char *buffer, int width, int pitch, int height, int pixelFormat)</td></tr>
<tr class="memdesc:gaa4ec838988e469cc15618e4690cc8722"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save an 8-bit-per-sample packed-pixel image from memory to disk.  <a href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722">More...</a><br /></td></tr>
<tr class="separator:gaa4ec838988e469cc15618e4690cc8722"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7c64b5106d04267a46aad85f9714ad90"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7c64b5106d04267a46aad85f9714ad90">tj3SaveImage12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, const short *buffer, int width, int pitch, int height, int pixelFormat)</td></tr>
<tr class="memdesc:ga7c64b5106d04267a46aad85f9714ad90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save a 12-bit-per-sample packed-pixel image from memory to disk.  <a href="group___turbo_j_p_e_g.html#ga7c64b5106d04267a46aad85f9714ad90">More...</a><br /></td></tr>
<tr class="separator:ga7c64b5106d04267a46aad85f9714ad90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0fd87851f4266aca24bf4594dd0c0e71"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0fd87851f4266aca24bf4594dd0c0e71">tj3SaveImage16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, const unsigned short *buffer, int width, int pitch, int height, int pixelFormat)</td></tr>
<tr class="memdesc:ga0fd87851f4266aca24bf4594dd0c0e71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save a 16-bit-per-sample packed-pixel image from memory to disk.  <a href="group___turbo_j_p_e_g.html#ga0fd87851f4266aca24bf4594dd0c0e71">More...</a><br /></td></tr>
<tr class="separator:ga0fd87851f4266aca24bf4594dd0c0e71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaddb84fb6c81769e9faa0f5a63b296606"><td class="memItemLeft" align="right" valign="top">DLLEXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606">tj3Free</a> (void *buffer)</td></tr>
<tr class="memdesc:gaddb84fb6c81769e9faa0f5a63b296606"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free a byte buffer previously allocated by TurboJPEG.  <a href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606">More...</a><br /></td></tr>
<tr class="separator:gaddb84fb6c81769e9faa0f5a63b296606"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2aab0e6dbb3edc57646b0fec25e8bb2"><td class="memItemLeft" align="right" valign="top">DLLEXPORT char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2">tj3GetErrorStr</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
<tr class="memdesc:gaf2aab0e6dbb3edc57646b0fec25e8bb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a descriptive error message explaining why the last command failed.  <a href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2">More...</a><br /></td></tr>
<tr class="separator:gaf2aab0e6dbb3edc57646b0fec25e8bb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab8c8279f1415fe425ff30dbbc56013bd"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd">tj3GetErrorCode</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
<tr class="memdesc:gab8c8279f1415fe425ff30dbbc56013bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a code indicating the severity of the last error.  <a href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd">More...</a><br /></td></tr>
<tr class="separator:gab8c8279f1415fe425ff30dbbc56013bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ga9e61e7cd47a15a173283ba94e781308c"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c">tjMCUWidth</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td></tr>
<tr class="memdesc:ga9e61e7cd47a15a173283ba94e781308c"><td class="mdescLeft">&#160;</td><td class="mdescRight">MCU block width (in pixels) for a given level of chrominance subsampling.  <a href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c">More...</a><br /></td></tr>
<tr class="separator:ga9e61e7cd47a15a173283ba94e781308c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd247bb9fecb393eca57366feb8327bf"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf">tjMCUHeight</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td></tr>
<tr class="memdesc:gabd247bb9fecb393eca57366feb8327bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">MCU block height (in pixels) for a given level of chrominance subsampling.  <a href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf">More...</a><br /></td></tr>
<tr class="separator:gabd247bb9fecb393eca57366feb8327bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadd9b446742ac8a3923f7992c7988fea8"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8">tjRedOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
<tr class="memdesc:gadd9b446742ac8a3923f7992c7988fea8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Red offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8">More...</a><br /></td></tr>
<tr class="separator:gadd9b446742ac8a3923f7992c7988fea8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82d6e35da441112a411da41923c0ba2f"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f">tjGreenOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
<tr class="memdesc:ga82d6e35da441112a411da41923c0ba2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Green offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f">More...</a><br /></td></tr>
<tr class="separator:ga82d6e35da441112a411da41923c0ba2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga84e2e35d3f08025f976ec1ec53693dea"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea">tjBlueOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
<tr class="memdesc:ga84e2e35d3f08025f976ec1ec53693dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Blue offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea">More...</a><br /></td></tr>
<tr class="separator:ga84e2e35d3f08025f976ec1ec53693dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5af0ab065feefd526debf1e20c43e837"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837">tjAlphaOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
<tr class="memdesc:ga5af0ab065feefd526debf1e20c43e837"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alpha offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837">More...</a><br /></td></tr>
<tr class="separator:ga5af0ab065feefd526debf1e20c43e837"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c">tjPixelSize</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
<tr class="memdesc:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel size (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c">More...</a><br /></td></tr>
<tr class="separator:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f192ad58a5a5802e145149d83c643bf"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="structtjregion.html">tjregion</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf">TJUNCROPPED</a></td></tr>
<tr class="memdesc:ga6f192ad58a5a5802e145149d83c643bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure that specifies no cropping.  <a href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf">More...</a><br /></td></tr>
<tr class="separator:ga6f192ad58a5a5802e145149d83c643bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7880644a0849161ad20933536169ee19"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19">TJUNSCALED</a></td></tr>
<tr class="memdesc:ga7880644a0849161ad20933536169ee19"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <a class="el" href="structtjscalingfactor.html" title="Scaling factor.">tjscalingfactor</a> structure that specifies a scaling factor of 1/1 (no scaling)  <a href="group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19">More...</a><br /></td></tr>
<tr class="separator:ga7880644a0849161ad20933536169ee19"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>TurboJPEG API. </p>
<p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.</p>
<p><a class="anchor" id="YUVnotes"></a></p>
<h2><a class="anchor" id="autotoc_md0"></a>
YUV Image Format Notes</h2>
<p>Technically, the JPEG format uses the YCbCr colorspace (which is technically not a colorspace but a color transform), but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
<p>Each plane is simply a 2D array of bytes, each byte representing the value of one of the components (Y, Cb, or Cr) at a particular location in the image. The width and height of each plane are determined by the image width, height, and level of chrominance subsampling. The luminance plane width is the image width padded to the nearest multiple of the horizontal subsampling factor (1 in the case of 4:4:4, grayscale, 4:4:0, or 4:4:1; 2 in the case of 4:2:2 or 4:2:0; 4 in the case of 4:1:1.) Similarly, the luminance plane height is the image height padded to the nearest multiple of the vertical subsampling factor (1 in the case of 4:4:4, 4:2:2, grayscale, or 4:1:1; 2 in the case of 4:2:0 or 4:4:0; 4 in the case of 4:4:1.) This is irrespective of any additional padding that may be specified as an argument to the various YUV functions. The chrominance plane width is equal to the luminance plane width divided by the horizontal subsampling factor, and the chrominance plane height is equal to the luminance plane height divided by the vertical subsampling factor.</p>
<p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 18 x 35 bytes. If you specify a row alignment of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 20 x 35 bytes. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga39f57a6fb02d9cf32e7b6890099b5a71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga39f57a6fb02d9cf32e7b6890099b5a71">&#9670;&nbsp;</a></span>TJ_NUMCS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMCS</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of JPEG colorspaces. </p>

</div>
</div>
<a id="ga79bde1b4a3e2351e00887e47781b966e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga79bde1b4a3e2351e00887e47781b966e">&#9670;&nbsp;</a></span>TJ_NUMERR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMERR</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of error codes. </p>

</div>
</div>
<a id="ga5e0e8c784295c636f0bf8dab93c4bddf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e0e8c784295c636f0bf8dab93c4bddf">&#9670;&nbsp;</a></span>TJ_NUMINIT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMINIT</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of initialization options. </p>

</div>
</div>
<a id="gaa628be5db276fc3676dfba205d45d780"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa628be5db276fc3676dfba205d45d780">&#9670;&nbsp;</a></span>TJ_NUMPARAM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMPARAM</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of parameters. </p>

</div>
</div>
<a id="ga7010a4402f54a45ba822ad8675a4655e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7010a4402f54a45ba822ad8675a4655e">&#9670;&nbsp;</a></span>TJ_NUMPF</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMPF</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of pixel formats. </p>

</div>
</div>
<a id="ga5ef3d169162ce77ce348e292a0b7477c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ef3d169162ce77ce348e292a0b7477c">&#9670;&nbsp;</a></span>TJ_NUMSAMP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMSAMP</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of chrominance subsampling options. </p>

</div>
</div>
<a id="ga0f6dbd18adf38b7d46ac547f0f4d562c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0f6dbd18adf38b7d46ac547f0f4d562c">&#9670;&nbsp;</a></span>TJ_NUMXOP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJ_NUMXOP</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of transform operations. </p>

</div>
</div>
<a id="ga84878bb65404204743aa18cac02781df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga84878bb65404204743aa18cac02781df">&#9670;&nbsp;</a></span>TJSCALED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJSCALED</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">dimension, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">scalingFactor&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compute the scaled value of <code>dimension</code> using the given scaling factor. </p>
<p>This macro performs the integer equivalent of <code>ceil(dimension * scalingFactor)</code>. </p>

</div>
</div>
<a id="gaecaaa3b7e2af812592c015d83207f010"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecaaa3b7e2af812592c015d83207f010">&#9670;&nbsp;</a></span>TJXOPT_ARITHMETIC</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_ARITHMETIC</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform. </p>
<p>Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding (the default), but it will reduce decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="This option will enable progressive entropy coding in the JPEG image generated by this particular tra...">TJXOPT_PROGRESSIVE</a>. </p>

</div>
</div>
<a id="ga153b468cfb905d0de61706c838986fe8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga153b468cfb905d0de61706c838986fe8">&#9670;&nbsp;</a></span>TJXOPT_COPYNONE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_COPYNONE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image. </p>

</div>
</div>
<a id="ga9c771a757fc1294add611906b89ab2d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9c771a757fc1294add611906b89ab2d2">&#9670;&nbsp;</a></span>TJXOPT_CROP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_CROP</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will enable lossless cropping. </p>
<p>See <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> for more information. </p>

</div>
</div>
<a id="ga3acee7b48ade1b99e5588736007c2589"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3acee7b48ade1b99e5588736007c2589">&#9670;&nbsp;</a></span>TJXOPT_GRAY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_GRAY</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will discard the color data in the source image and produce a grayscale destination image. </p>

</div>
</div>
<a id="gafbf992bbf6e006705886333703ffab31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafbf992bbf6e006705886333703ffab31">&#9670;&nbsp;</a></span>TJXOPT_NOOUTPUT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_NOOUTPUT</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from outputting a JPEG image for this particular transform. </p>
<p>(This can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>

</div>
</div>
<a id="ga6bedf37aa9e1122f3ec9f7302ca59117"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6bedf37aa9e1122f3ec9f7302ca59117">&#9670;&nbsp;</a></span>TJXOPT_OPTIMIZE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_OPTIMIZE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform. </p>
<p>Optimized baseline entropy coding will improve compression slightly (generally 5% or less.) </p>

</div>
</div>
<a id="ga50e03cb5ed115330e212417429600b00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga50e03cb5ed115330e212417429600b00">&#9670;&nbsp;</a></span>TJXOPT_PERFECT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_PERFECT</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect. </p>
<p>Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>

</div>
</div>
<a id="gad2371c80674584ecc1a7d75e564cf026"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad2371c80674584ecc1a7d75e564cf026">&#9670;&nbsp;</a></span>TJXOPT_PROGRESSIVE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_PROGRESSIVE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will enable progressive entropy coding in the JPEG image generated by this particular transform. </p>
<p>Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="This option will enable optimized baseline entropy coding in the JPEG image generated by this particu...">TJXOPT_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a> is also specified. </p>

</div>
</div>
<a id="ga319826b7eb1583c0595bbe7b95428709"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga319826b7eb1583c0595bbe7b95428709">&#9670;&nbsp;</a></span>TJXOPT_TRIM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TJXOPT_TRIM</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to discard any partial MCU blocks that cannot be transformed. </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga758d2634ecb4949de7815cba621f5763"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga758d2634ecb4949de7815cba621f5763">&#9670;&nbsp;</a></span>tjhandle</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void* <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TurboJPEG instance handle. </p>

</div>
</div>
<a id="ga504805ec0161f1b505397ca0118bf8fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga504805ec0161f1b505397ca0118bf8fd">&#9670;&nbsp;</a></span>tjtransform</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structtjtransform.html">tjtransform</a> <a class="el" href="structtjtransform.html">tjtransform</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lossless transform. </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga4f83ad3368e0e29d1957be0efa7c3720"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4f83ad3368e0e29d1957be0efa7c3720">&#9670;&nbsp;</a></span>TJCS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">TJCS</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>JPEG colorspaces. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555"></a>TJCS_RGB&#160;</td><td class="fielddoc"><p>RGB colorspace. </p>
<p>When compressing the JPEG image, the R, G, and B components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. RGB JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, but they cannot be compressed from or decompressed to planar YUV images. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75"></a>TJCS_YCbCr&#160;</td><td class="fielddoc"><p>YCbCr colorspace. </p>
<p>YCbCr is not an absolute colorspace but rather a mathematical transformation of RGB designed solely for storage and transmission. YCbCr images must be converted to RGB before they can actually be displayed. In the YCbCr colorspace, the Y (luminance) component represents the black &amp; white portion of the original image, and the Cb and Cr (chrominance) components represent the color portion of the original image. Originally, the analog equivalent of this transformation allowed the same signal to drive both black &amp; white and color televisions, but JPEG images use YCbCr primarily because it allows the color data to be optionally subsampled for the purposes of reducing network or disk usage. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats. YCbCr JPEG images can also be compressed from and decompressed to planar YUV images. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a"></a>TJCS_GRAY&#160;</td><td class="fielddoc"><p>Grayscale colorspace. </p>
<p>The JPEG image retains only the luminance data (Y component), and any color data from the source image is discarded. Grayscale JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, or they can be compressed from and decompressed to planar YUV images. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53"></a>TJCS_CMYK&#160;</td><td class="fielddoc"><p>CMYK colorspace. </p>
<p>When compressing the JPEG image, the C, M, Y, and K components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. CMYK JPEG images can only be compressed from and decompressed to packed-pixel images with the CMYK pixel format. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e"></a>TJCS_YCCK&#160;</td><td class="fielddoc"><p>YCCK colorspace. </p>
<p>YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a mathematical transformation of CMYK designed solely for storage and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be reversibly transformed into YCCK, and as with YCbCr, the chrominance components in the YCCK pixels can be subsampled without incurring major perceptual loss. YCCK JPEG images can only be compressed from and decompressed to packed-pixel images with the CMYK pixel format. </p>
</td></tr>
</table>

</div>
</div>
<a id="gafbc17cfa57d0d5d11fea35ac025950fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafbc17cfa57d0d5d11fea35ac025950fe">&#9670;&nbsp;</a></span>TJERR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">TJERR</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Error codes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggafbc17cfa57d0d5d11fea35ac025950fea342dd6e2aedb47bb257b4e7568329b59"></a>TJERR_WARNING&#160;</td><td class="fielddoc"><p>The error was non-fatal and recoverable, but the destination image may still be corrupt. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a"></a>TJERR_FATAL&#160;</td><td class="fielddoc"><p>The error was fatal and non-recoverable. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga3850bbee1313e752e667b4eb08b1e086"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3850bbee1313e752e667b4eb08b1e086">&#9670;&nbsp;</a></span>TJINIT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">TJINIT</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialization options. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga3850bbee1313e752e667b4eb08b1e086aa45ac279e3dc6ffabc4b0f45864da796"></a>TJINIT_COMPRESS&#160;</td><td class="fielddoc"><p>Initialize the TurboJPEG instance for compression. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga3850bbee1313e752e667b4eb08b1e086a4b8ca1ef700699b71350700bf95c2167"></a>TJINIT_DECOMPRESS&#160;</td><td class="fielddoc"><p>Initialize the TurboJPEG instance for decompression. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga3850bbee1313e752e667b4eb08b1e086a8d58a2a4c45b3e0cd349746544a6e0c2"></a>TJINIT_TRANSFORM&#160;</td><td class="fielddoc"><p>Initialize the TurboJPEG instance for lossless transformation (both compression and decompression.) </p>
</td></tr>
</table>

</div>
</div>
<a id="gaa0f6be63ba78278299c9f5c12031fe82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa0f6be63ba78278299c9f5c12031fe82">&#9670;&nbsp;</a></span>TJPARAM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">TJPARAM</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parameters. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a555e2212079fa49b30bcd2879c6c8ddb"></a>TJPARAM_STOPONWARNING&#160;</td><td class="fielddoc"><p>Error handling behavior. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default]</em> Allow the current compression/decompression/transform operation to complete unless a fatal error is encountered.</li>
<li><code>1</code> Immediately discontinue the current compression/decompression/transform operation if a warning (non-fatal error) occurs. </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a924657172695ed6cb0b128219546fcce"></a>TJPARAM_BOTTOMUP&#160;</td><td class="fielddoc"><p>Row order in packed-pixel source/destination images. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default]</em> top-down (X11) order</li>
<li><code>1</code> bottom-up (Windows, OpenGL) order </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b"></a>TJPARAM_NOREALLOC&#160;</td><td class="fielddoc"><p>JPEG destination buffer (re)allocation [compression, lossless transformation]. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default]</em> Attempt to allocate or reallocate the JPEG destination buffer as needed.</li>
<li><code>1</code> Generate an error if the JPEG destination buffer is invalid or too small. </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a0467e8792621f2d817dc2af563d3186c"></a>TJPARAM_QUALITY&#160;</td><td class="fielddoc"><p>Perceptual quality of lossy JPEG images [compression only]. </p>
<p><b>Value</b></p><ul>
<li><code>1</code>-<code>100</code> (<code>1</code> = worst quality but best compression, <code>100</code> = best quality but worst compression) <em>[no default; must be explicitly specified]</em> </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a"></a>TJPARAM_SUBSAMP&#160;</td><td class="fielddoc"><p>Chrominance subsampling level. </p>
<p>The JPEG or YUV image uses (decompression, decoding) or will use (lossy compression, encoding) the specified level of chrominance subsampling.</p>
<p><b>Value</b></p><ul>
<li>One of the <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">chrominance subsampling options</a> <em>[no default; must be explicitly specified for lossy compression, encoding, and decoding]</em> </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8"></a>TJPARAM_JPEGWIDTH&#160;</td><td class="fielddoc"><p>JPEG width (in pixels) [decompression only, read-only]. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f"></a>TJPARAM_JPEGHEIGHT&#160;</td><td class="fielddoc"><p>JPEG height (in pixels) [decompression only, read-only]. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8"></a>TJPARAM_PRECISION&#160;</td><td class="fielddoc"><p>JPEG data precision (bits per sample) [decompression only, read-only]. </p>
<p>The JPEG image uses the specified number of bits per sample.</p>
<p><b>Value</b></p><ul>
<li><code>8</code>, <code>12</code>, or <code>16</code></li>
</ul>
<p>12-bit data precision implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Optimized baseline entropy coding [lossy compression only].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is set. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c"></a>TJPARAM_COLORSPACE&#160;</td><td class="fielddoc"><p>JPEG colorspace. </p>
<p>The JPEG image uses (decompression) or will use (lossy compression) the specified colorspace.</p>
<p><b>Value</b></p><ul>
<li>One of the <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a> <em>[default for lossy compression: automatically selected based on the subsampling level and pixel format]</em> </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0"></a>TJPARAM_FASTUPSAMPLE&#160;</td><td class="fielddoc"><p>Chrominance upsampling algorithm [lossy decompression only]. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default]</em> Use smooth upsampling when decompressing a JPEG image that was compressed using chrominance subsampling. This creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image.</li>
<li><code>1</code> Use the fastest chrominance upsampling algorithm available, which may combine upsampling with color conversion. </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627"></a>TJPARAM_FASTDCT&#160;</td><td class="fielddoc"><p>DCT/IDCT algorithm [lossy compression and decompression]. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default]</em> Use the most accurate DCT/IDCT algorithm available.</li>
<li><code>1</code> Use the fastest DCT/IDCT algorithm available.</li>
</ul>
<p>This parameter is provided mainly for backward compatibility with libjpeg, which historically implemented several different DCT/IDCT algorithms because of performance limitations with 1990s CPUs. In the libjpeg-turbo implementation of the TurboJPEG API:</p><ul>
<li>The "fast" and "accurate" DCT/IDCT algorithms perform similarly on modern x86/x86-64 CPUs that support AVX2 instructions.</li>
<li>The "fast" algorithm is generally only about 5-15% faster than the "accurate" algorithm on other types of CPUs.</li>
<li>The difference in accuracy between the "fast" and "accurate" algorithms is the most pronounced at JPEG quality levels above 90 and tends to be more pronounced with decompression than with compression.</li>
<li>The "fast" algorithm degrades and is not fully accelerated for JPEG quality levels above 97, so it will be slower than the "accurate" algorithm. </li>
</ul>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6"></a>TJPARAM_OPTIMIZE&#160;</td><td class="fielddoc"><p>Optimized baseline entropy coding [lossy compression only]. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default]</em> The JPEG image will use the default Huffman tables.</li>
<li><code>1</code> Optimal Huffman tables will be computed for the JPEG image. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="This option will enable optimized baseline entropy coding in the JPEG image generated by this particu...">TJXOPT_OPTIMIZE</a>.</li>
</ul>
<p>Optimized baseline entropy coding will improve compression slightly (generally 5% or less), but it will reduce compression performance considerably. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f"></a>TJPARAM_PROGRESSIVE&#160;</td><td class="fielddoc"><p>Progressive entropy coding. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) baseline entropy coding.</li>
<li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) progressive entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="This option will enable progressive entropy coding in the JPEG image generated by this particular tra...">TJXOPT_PROGRESSIVE</a>.</li>
</ul>
<p>Progressive entropy coding will generally improve compression relative to baseline entropy coding, but it will reduce compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Optimized baseline entropy coding [lossy compression only].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is also set. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167"></a>TJPARAM_SCANLIMIT&#160;</td><td class="fielddoc"><p>Progressive JPEG scan limit for lossy JPEG images [decompression, lossless transformation]. </p>
<p>Setting this parameter will cause the decompression and transform functions to return an error if the number of scans in a progressive JPEG image exceeds the specified limit. The primary purpose of this is to allow security-critical applications to guard against an exploit of the progressive JPEG format described in <a href="https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf" target="_blank">this report</a>.</p>
<p><b>Value</b></p><ul>
<li>maximum number of progressive JPEG scans that the decompression and transform functions will process <em>[default: <code>0</code> (no limit)]</em></li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive entropy coding.">TJPARAM_PROGRESSIVE</a> </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7"></a>TJPARAM_ARITHMETIC&#160;</td><td class="fielddoc"><p>Arithmetic entropy coding. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) Huffman entropy coding.</li>
<li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) arithmetic entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a>.</li>
</ul>
<p>Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding, but it will reduce compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive entropy coding.">TJPARAM_PROGRESSIVE</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f"></a>TJPARAM_LOSSLESS&#160;</td><td class="fielddoc"><p>Lossless JPEG. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default for compression]</em> The JPEG image is (decompression) or will be (compression) lossy/DCT-based.</li>
<li><code>1</code> The JPEG image is (decompression) or will be (compression) lossless/predictive.</li>
</ul>
<p>In most cases, compressing and decompressing lossless JPEG images is considerably slower than compressing and decompressing lossy JPEG images. Also note that the following features are not available with lossless JPEG images:</p><ul>
<li>Colorspace conversion (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555" title="RGB colorspace.">TJCS_RGB</a>, <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a" title="Grayscale colorspace.">TJCS_GRAY</a>, or <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53" title="CMYK colorspace.">TJCS_CMYK</a>, depending on the pixel format of the source image)</li>
<li>Chrominance subsampling (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>)</li>
<li>JPEG quality selection</li>
<li>DCT/IDCT algorithm selection</li>
<li>Progressive entropy coding</li>
<li>Arithmetic entropy coding</li>
<li>Compression from/decompression to planar YUV images</li>
<li>Decompression scaling</li>
<li>Lossless transformation</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159" title="Lossless JPEG predictor selection value (PSV)">TJPARAM_LOSSLESSPSV</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a" title="Lossless JPEG point transform (Pt)">TJPARAM_LOSSLESSPT</a> </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159"></a>TJPARAM_LOSSLESSPSV&#160;</td><td class="fielddoc"><p>Lossless JPEG predictor selection value (PSV) </p>
<p><b>Value</b></p><ul>
<li><code>1</code>-<code>7</code> <em>[default for compression: <code>1</code>]</em></li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" title="Lossless JPEG.">TJPARAM_LOSSLESS</a> </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a"></a>TJPARAM_LOSSLESSPT&#160;</td><td class="fielddoc"><p>Lossless JPEG point transform (Pt) </p>
<p><b>Value</b></p><ul>
<li><code>0</code> through <em><b>precision</b></em> <em>- 1</em>, where <em><b>precision</b></em> is the JPEG data precision in bits <em>[default for compression: <code>0</code>]</em></li>
</ul>
<p>A point transform value of <code>0</code> is necessary in order to generate a fully lossless JPEG image. (A non-zero point transform value right-shifts the input samples by the specified number of bits, which is effectively a form of lossy color quantization.)</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" title="Lossless JPEG.">TJPARAM_LOSSLESS</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8" title="JPEG data precision (bits per sample) [decompression only, read-only].">TJPARAM_PRECISION</a> </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec"></a>TJPARAM_RESTARTBLOCKS&#160;</td><td class="fielddoc"><p>JPEG restart marker interval in MCU blocks (lossy) or samples (lossless) [compression only]. </p>
<p>The nature of entropy coding is such that a corrupt JPEG image cannot be decompressed beyond the point of corruption unless it contains restart markers. A restart marker stops and restarts the entropy coding algorithm so that, if a JPEG image is corrupted, decompression can resume at the next marker. Thus, adding more restart markers improves the fault tolerance of the JPEG image, but adding too many restart markers can adversely affect the compression ratio and performance.</p>
<p><b>Value</b></p><ul>
<li>the number of MCU blocks or samples between each restart marker <em>[default: <code>0</code> (no restart markers)]</em></li>
</ul>
<p>Setting this parameter to a non-zero value sets <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c" title="JPEG restart marker interval in MCU rows (lossy) or sample rows (lossless) [compression only].">TJPARAM_RESTARTROWS</a> to 0. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c"></a>TJPARAM_RESTARTROWS&#160;</td><td class="fielddoc"><p>JPEG restart marker interval in MCU rows (lossy) or sample rows (lossless) [compression only]. </p>
<p>See <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec" title="JPEG restart marker interval in MCU blocks (lossy) or samples (lossless) [compression only].">TJPARAM_RESTARTBLOCKS</a> for a description of restart markers.</p>
<p><b>Value</b></p><ul>
<li>the number of MCU rows or sample rows between each restart marker <em>[default: <code>0</code> (no restart markers)]</em></li>
</ul>
<p>Setting this parameter to a non-zero value sets <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec" title="JPEG restart marker interval in MCU blocks (lossy) or samples (lossless) [compression only].">TJPARAM_RESTARTBLOCKS</a> to 0. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877"></a>TJPARAM_XDENSITY&#160;</td><td class="fielddoc"><p>JPEG horizontal pixel density. </p>
<p><b>Value</b></p><ul>
<li>The JPEG image has (decompression) or will have (compression) the specified horizontal pixel density <em>[default for compression: <code>1</code>]</em>.</li>
</ul>
<p>This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a> when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by <a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722" title="Save an 8-bit-per-sample packed-pixel image from memory to disk.">tj3SaveImage8()</a> if the value of #TJPARAM_DENSITYUNIT is <code>2</code>.</p>
<dl class="section see"><dt>See also</dt><dd>TJPARAM_DENSITYUNIT </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba"></a>TJPARAM_YDENSITY&#160;</td><td class="fielddoc"><p>JPEG vertical pixel density. </p>
<p><b>Value</b></p><ul>
<li>The JPEG image has (decompression) or will have (compression) the specified vertical pixel density <em>[default for compression: <code>1</code>]</em>.</li>
</ul>
<p>This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a> when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by <a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722" title="Save an 8-bit-per-sample packed-pixel image from memory to disk.">tj3SaveImage8()</a> if the value of #TJPARAM_DENSITYUNIT is <code>2</code>.</p>
<dl class="section see"><dt>See also</dt><dd>TJPARAM_DENSITYUNIT </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a4c045981bd8a303521a401dbbe1df208"></a>TJPARAM_DENSITYUNITS&#160;</td><td class="fielddoc"><p>JPEG pixel density units. </p>
<p><b>Value</b></p><ul>
<li><code>0</code> <em>[default for compression]</em> The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in unknown units.</li>
<li><code>1</code> The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in units of pixels/inch.</li>
<li><code>2</code> The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in units of pixels/cm.</li>
</ul>
<p>This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a> when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by <a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722" title="Save an 8-bit-per-sample packed-pixel image from memory to disk.">tj3SaveImage8()</a> if the value is <code>2</code>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877" title="JPEG horizontal pixel density.">TJPARAM_XDENSITY</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba" title="JPEG vertical pixel density.">TJPARAM_YDENSITY</a> </dd></dl>
</td></tr>
</table>

</div>
</div>
<a id="gac916144e26c3817ac514e64ae5d12e2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac916144e26c3817ac514e64ae5d12e2a">&#9670;&nbsp;</a></span>TJPF</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">TJPF</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pixel formats. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c"></a>TJPF_RGB&#160;</td><td class="fielddoc"><p>RGB pixel format. </p>
<p>The red, green, and blue components in the image are stored in 3-sample pixels in the order R, G, B from lowest to highest memory address within each pixel. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839"></a>TJPF_BGR&#160;</td><td class="fielddoc"><p>BGR pixel format. </p>
<p>The red, green, and blue components in the image are stored in 3-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01"></a>TJPF_RGBX&#160;</td><td class="fielddoc"><p>RGBX pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from lowest to highest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8"></a>TJPF_BGRX&#160;</td><td class="fielddoc"><p>BGRX pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af"></a>TJPF_XBGR&#160;</td><td class="fielddoc"><p>XBGR pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from highest to lowest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84"></a>TJPF_XRGB&#160;</td><td class="fielddoc"><p>XRGB pixel format. </p>
<p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from highest to lowest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a"></a>TJPF_GRAY&#160;</td><td class="fielddoc"><p>Grayscale pixel format. </p>
<p>Each 1-sample pixel represents a luminance (brightness) level from 0 to the maximum sample value (255 for 8-bit samples, 4095 for 12-bit samples, and 65535 for 16-bit samples.) </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12"></a>TJPF_RGBA&#160;</td><td class="fielddoc"><p>RGBA pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4"></a>TJPF_BGRA&#160;</td><td class="fielddoc"><p>BGRA pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081"></a>TJPF_ABGR&#160;</td><td class="fielddoc"><p>ABGR pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c"></a>TJPF_ARGB&#160;</td><td class="fielddoc"><p>ARGB pixel format. </p>
<p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b"></a>TJPF_CMYK&#160;</td><td class="fielddoc"><p>CMYK pixel format. </p>
<p>Unlike RGB, which is an additive color model used primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used primarily for printing. In the CMYK color model, the value of each color component typically corresponds to an amount of cyan, magenta, yellow, or black ink that is applied to a white background. In order to convert between CMYK and RGB, it is necessary to use a color management system (CMS.) A CMS will attempt to map colors within the printer's gamut to perceptually similar colors in the display's gamut and vice versa, but the mapping is typically not 1:1 or reversible, nor can it be defined with a simple formula. Thus, such a conversion is out of scope for a codec library. However, the TurboJPEG API allows for compressing packed-pixel CMYK images into YCCK JPEG images (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) and decompressing YCCK JPEG images into packed-pixel CMYK images. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed"></a>TJPF_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown pixel format. </p>
<p>Currently this is only used by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ga1f03c26892a26d4ce077ed6a4ac40e8f" title="Load a 12-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage12()</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga638aeba63e0ccb89d472fdbf34224cfc" title="Load a 16-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage16()</a>. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga1d047060ea80bb9820d540bb928e9074"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1d047060ea80bb9820d540bb928e9074">&#9670;&nbsp;</a></span>TJSAMP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">TJSAMP</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Chrominance subsampling options. </p>
<p>When pixels are converted from RGB to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity. (The human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling". </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444&#160;</td><td class="fielddoc"><p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>
<p>The JPEG or YUV image will contain one chrominance component for every pixel in the source image. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404"></a>TJSAMP_422&#160;</td><td class="fielddoc"><p>4:2:2 chrominance subsampling. </p>
<p>The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737"></a>TJSAMP_420&#160;</td><td class="fielddoc"><p>4:2:0 chrominance subsampling. </p>
<p>The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248"></a>TJSAMP_GRAY&#160;</td><td class="fielddoc"><p>Grayscale. </p>
<p>The JPEG or YUV image will contain no chrominance components. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440&#160;</td><td class="fielddoc"><p>4:4:0 chrominance subsampling. </p>
<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>
<dl class="section note"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411&#160;</td><td class="fielddoc"><p>4:1:1 chrominance subsampling. </p>
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>
<dl class="section note"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d"></a>TJSAMP_441&#160;</td><td class="fielddoc"><p>4:4:1 chrominance subsampling. </p>
<p>The JPEG or YUV image will contain one chrominance component for every 1x4 block of pixels in the source image. JPEG images compressed with 4:4:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:4:1 is better able to reproduce sharp vertical features.</p>
<dl class="section note"><dt>Note</dt><dd>4:4:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
</td></tr>
<tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173"></a>TJSAMP_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown subsampling. </p>
<p>The JPEG image uses an unusual type of chrominance subsampling. Such images can be decompressed into packed-pixel images, but they cannot be</p><ul>
<li>decompressed into planar YUV images,</li>
<li>losslessly transformed if <a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2" title="This option will enable lossless cropping.">TJXOPT_CROP</a> is specified, or</li>
<li>partially decompressed using a cropping region. </li>
</ul>
</td></tr>
</table>

</div>
</div>
<a id="ga2de531af4e7e6c4f124908376b354866"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2de531af4e7e6c4f124908376b354866">&#9670;&nbsp;</a></span>TJXOP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">TJXOP</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27"></a>TJXOP_NONE&#160;</td><td class="fielddoc"><p>Do not transform the position of the image pixels. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce"></a>TJXOP_HFLIP&#160;</td><td class="fielddoc"><p>Flip (mirror) image horizontally. </p>
<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d"></a>TJXOP_VFLIP&#160;</td><td class="fielddoc"><p>Flip (mirror) image vertically. </p>
<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d"></a>TJXOP_TRANSPOSE&#160;</td><td class="fielddoc"><p>Transpose image (flip/mirror along upper left to lower right axis.) This transform is always perfect. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4"></a>TJXOP_TRANSVERSE&#160;</td><td class="fielddoc"><p>Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128"></a>TJXOP_ROT90&#160;</td><td class="fielddoc"><p>Rotate image clockwise by 90 degrees. </p>
<p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692"></a>TJXOP_ROT180&#160;</td><td class="fielddoc"><p>Rotate image 180 degrees. </p>
<p>This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08"></a>TJXOP_ROT270&#160;</td><td class="fielddoc"><p>Rotate image counter-clockwise by 90 degrees. </p>
<p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab40a0b231122f536e503e3394569a68d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab40a0b231122f536e503e3394569a68d">&#9670;&nbsp;</a></span>tj3Alloc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT void* tj3Alloc </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>bytes</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Allocate a byte buffer for use with TurboJPEG. </p>
<p>You should always use this function to allocate the JPEG destination buffer(s) for the compression and transform functions unless you are disabling automatic buffer (re)allocation (by setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>.)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bytes</td><td>the number of bytes to allocate</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a> </dd></dl>

</div>
</div>
<a id="ga9a1968c384ec7abb6122830253ebf570"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9a1968c384ec7abb6122830253ebf570">&#9670;&nbsp;</a></span>tj3Compress12()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Compress12 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const short *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>jpegSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compress a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 12-bit-per-sample JPEG image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK source image to be compressed. This buffer should normally be <code>pitch * height</code> samples in size. However, you can also use this parameter to compress from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to compress from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol>
If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
    <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga77901b71d0471784f318ada31ff4e7bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga77901b71d0471784f318ada31ff4e7bd">&#9670;&nbsp;</a></span>tj3Compress16()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Compress16 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned short *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>jpegSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compress a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 16-bit-per-sample lossless JPEG image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK source image to be compressed. This buffer should normally be <code>pitch * height</code> samples in size. However, you can also use this parameter to compress from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to compress from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol>
If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
    <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga2cc418a2dab709ad7f30f5b25905f138"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2cc418a2dab709ad7f30f5b25905f138">&#9670;&nbsp;</a></span>tj3Compress8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Compress8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>jpegSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compress an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into an 8-bit-per-sample JPEG image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK source image to be compressed. This buffer should normally be <code>pitch * height</code> samples in size. However, you can also use this parameter to compress from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to compress from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol>
If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
    <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga041c870d9c669eb3f385c78f4346c43f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga041c870d9c669eb3f385c78f4346c43f">&#9670;&nbsp;</a></span>tj3CompressFromYUV8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3CompressFromYUV8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>jpegSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compress an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample JPEG image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a unified planar YUV source image to be compressed. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> for the given image width, height, row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed.</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in bytes) of the source image (must be a power of 2.) Setting this parameter to n indicates that each row in each plane of the source image is padded to the nearest multiple of n bytes (1 = unpadded.)</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed.</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol>
If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
    <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gac9f5ace3e73805b476c95dda9f8d0cd0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac9f5ace3e73805b476c95dda9f8d0cd0">&#9670;&nbsp;</a></span>tj3CompressFromYUVPlanes8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3CompressFromYUVPlanes8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *const *&#160;</td>
          <td class="paramname"><em>srcPlanes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int *&#160;</td>
          <td class="paramname"><em>strides</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>jpegSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compress a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample JPEG image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV source image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> for the given image width, height, strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed.</td></tr>
    <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of row padding in each plane or to create a JPEG image from a subregion of a larger planar YUV image.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed.</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
</ol>
If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
    <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gaa1eb574f38b1c1de43a6c7aafcf68d8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa1eb574f38b1c1de43a6c7aafcf68d8c">&#9670;&nbsp;</a></span>tj3DecodeYUV8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3DecodeYUV8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decode an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample packed-pixel RGB or grayscale image. </p>
<p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG decompression process.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a unified planar YUV source image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> for the given image width, height, row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in bytes) of the YUV source image (must be a power of 2.) Setting this parameter to n indicates that each row in each plane of the YUV source image is padded to the nearest multiple of n bytes (1 = unpadded.)</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decoded image. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to decode into a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
    <tr><td class="paramname">pitch</td><td>bytes per row in the destination image. Normally this should be set to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decode into a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gad366f1915f82c1ad4e7e37ebe073ca89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad366f1915f82c1ad4e7e37ebe073ca89">&#9670;&nbsp;</a></span>tj3DecodeYUVPlanes8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3DecodeYUVPlanes8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *const *&#160;</td>
          <td class="paramname"><em>srcPlanes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int *&#160;</td>
          <td class="paramname"><em>strides</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decode a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample packed-pixel RGB or grayscale image. </p>
<p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG decompression process.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> for the given image width, height, strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
    <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of row padding in each plane or to decode a subregion of a larger planar YUV image.</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decoded image. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to decode into a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
    <tr><td class="paramname">pitch</td><td>bytes per row in the destination image. Normally this should be set to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decode into a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga39b848f01781ad74a5b3941c012b6199"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga39b848f01781ad74a5b3941c012b6199">&#9670;&nbsp;</a></span>tj3Decompress12()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Decompress12 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">short *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decompress a 12-bit-per-sample JPEG image into a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image. </p>
<p>The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decompressed image. This buffer should normally be <code>pitch * destinationHeight</code> samples in size. However, you can also use this parameter to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationHeight</code> is either the scaled JPEG height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the height of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationHeight</code> is the JPEG height.</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the destination image. Normally this should be set to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationWidth</code> is either the scaled JPEG width (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the width of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationWidth</code> is the JPEG width.</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gaa074e63f9beb0b3ff42b833a4049df6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa074e63f9beb0b3ff42b833a4049df6e">&#9670;&nbsp;</a></span>tj3Decompress16()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Decompress16 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decompress a 16-bit-per-sample lossless JPEG image into a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image. </p>
<p>The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decompressed image. This buffer should normally be <code>pitch * destinationHeight</code> samples in size. However, you can also use this parameter to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationHeight</code> is either the scaled JPEG height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the height of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationHeight</code> is the JPEG height.</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the destination image. Normally this should be set to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationWidth</code> is either the scaled JPEG width (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the width of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationWidth</code> is the JPEG width.</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga1169c7c1a26ec18c9e6122cb8ae64013"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1169c7c1a26ec18c9e6122cb8ae64013">&#9670;&nbsp;</a></span>tj3Decompress8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Decompress8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image. </p>
<p>The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decompressed image. This buffer should normally be <code>pitch * destinationHeight</code> samples in size. However, you can also use this parameter to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationHeight</code> is either the scaled JPEG height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the height of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationHeight</code> is the JPEG height.</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the destination image. Normally this should be set to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationWidth</code> is either the scaled JPEG width (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the width of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationWidth</code> is the JPEG width.</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga96d2c4b3432f9d88ad14758ae240b8d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga96d2c4b3432f9d88ad14758ae240b8d1">&#9670;&nbsp;</a></span>tj3DecompressHeader()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3DecompressHeader </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quantization and Huffman tables. </p>
<p>If a JPEG image is passed to this function, then the <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when the function returns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing a JPEG image or an "abbreviated table specification" (AKA "tables-only") datastream. Passing a tables-only datastream to this function primes the decompressor with quantization and Huffman tables that can be used when decompressing subsequent "abbreviated image" datastreams. This is useful, for instance, when decompressing video streams in which all frames share the same quantization and Huffman tables.</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image or tables-only datastream (in bytes)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga1e6bf6a19fec3f9fa7534348879d8320"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e6bf6a19fec3f9fa7534348879d8320">&#9670;&nbsp;</a></span>tj3DecompressToYUV8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3DecompressToYUV8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample unified planar YUV image. </p>
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the unified planar YUV decompressed image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> to determine the appropriate size for this buffer based on the scaled JPEG width and height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>), row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in bytes) of the YUV image (must be a power of 2.) Setting this parameter to n will cause each row in each plane of the YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.) To generate images suitable for X Video, <code>align</code> should be set to 4.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga934373482dbbf257f2280505b6ff4fb5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga934373482dbbf257f2280505b6ff4fb5">&#9670;&nbsp;</a></span>tj3DecompressToYUVPlanes8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3DecompressToYUVPlanes8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>dstPlanes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>strides</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Decompress an 8-bit-per-sample JPEG image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes. </p>
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
    <tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the decompressed image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> to determine the appropriate size for each plane based on the scaled JPEG width and height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>), strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
    <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of row padding to each plane or to decompress the JPEG image into a subregion of a larger planar YUV image.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="ga53fbadf4560e95a65b8f5ab81703fe82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga53fbadf4560e95a65b8f5ab81703fe82">&#9670;&nbsp;</a></span>tj3Destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT void tj3Destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a TurboJPEG instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance. If the handle is NULL, then this function has no effect. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2a8d50f130bde10f0a04030f8cc59936"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2a8d50f130bde10f0a04030f8cc59936">&#9670;&nbsp;</a></span>tj3EncodeYUV8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3EncodeYUV8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>dstBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into an 8-bit-per-sample unified planar YUV image. </p>
<p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG compression process.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB or grayscale source image to be encoded. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to encode from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pitch</td><td>bytes per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to encode from a specific region of a larger packed-pixel image.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
    <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the unified planar YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> to determine the appropriate size for this buffer based on the image width, height, row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in bytes) of the YUV image (must be a power of 2.) Setting this parameter to n will cause each row in each plane of the YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.) To generate images suitable for X Video, <code>align</code> should be set to 4.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gae2e9df38790e9bddc249d04cb158a4cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae2e9df38790e9bddc249d04cb158a4cf">&#9670;&nbsp;</a></span>tj3EncodeYUVPlanes8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3EncodeYUVPlanes8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>srcBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>dstPlanes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>strides</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes. </p>
<p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG compression process.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
    <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB or grayscale source image to be encoded. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to encode from a specific region of a larger buffer.</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pitch</td><td>bytes per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to encode from a specific region of a larger packed-pixel image.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
    <tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
    <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to add an arbitrary amount of row padding to each plane or to encode an RGB or grayscale image into a subregion of a larger planar YUV image.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gaddb84fb6c81769e9faa0f5a63b296606"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaddb84fb6c81769e9faa0f5a63b296606">&#9670;&nbsp;</a></span>tj3Free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT void tj3Free </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free a byte buffer previously allocated by TurboJPEG. </p>
<p>You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by the compression and transform functions or that were manually allocated using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>address of the buffer to free. If the address is NULL, then this function has no effect.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> </dd></dl>

</div>
</div>
<a id="ga34af9ba3183bdf0ec7c8f47bb9a4c84f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga34af9ba3183bdf0ec7c8f47bb9a4c84f">&#9670;&nbsp;</a></span>tj3Get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>param</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the value of a parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">param</td><td>one of the <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the value of the specified parameter, or -1 if the value is unknown. </dd></dl>

</div>
</div>
<a id="gab8c8279f1415fe425ff30dbbc56013bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab8c8279f1415fe425ff30dbbc56013bd">&#9670;&nbsp;</a></span>tj3GetErrorCode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3GetErrorCode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a code indicating the severity of the last error. </p>
<p>See <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">Error codes</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a code indicating the severity of the last error. See <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">Error codes</a>. </dd></dl>

</div>
</div>
<a id="gaf2aab0e6dbb3edc57646b0fec25e8bb2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf2aab0e6dbb3edc57646b0fec25e8bb2">&#9670;&nbsp;</a></span>tj3GetErrorStr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT char* tj3GetErrorStr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a descriptive error message explaining why the last command failed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance, or NULL if the error was generated by a global function (but note that retrieving the error message for a global function is thread-safe only on platforms that support thread-local storage.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a descriptive error message explaining why the last command failed. </dd></dl>

</div>
</div>
<a id="ga74397f8e0587d4233182c72f085aaf04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga74397f8e0587d4233182c72f085aaf04">&#9670;&nbsp;</a></span>tj3GetScalingFactors()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>* tj3GetScalingFactors </td>
          <td>(</td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>numScalingFactors</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a list of fractional scaling factors that the JPEG decompressor supports. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">numScalingFactors</td><td>pointer to an integer variable that will receive the number of elements in the list</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a list of fractional scaling factors, or NULL if an error is encountered (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="ga69c09d39f97ec30250ad3605ace7e5df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga69c09d39f97ec30250ad3605ace7e5df">&#9670;&nbsp;</a></span>tj3Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> tj3Init </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>initType</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new TurboJPEG instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">initType</td><td>one of the <a class="el" href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">initialization options</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="gac6285e58e35a35d871d7162ec5a929c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac6285e58e35a35d871d7162ec5a929c4">&#9670;&nbsp;</a></span>tj3JPEGBufSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT size_t tj3JPEGBufSize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>jpegSubsamp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. </p>
<p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, so it is possible for a very high-quality source image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent very rare corner cases, but since there is no way to predict the size of a JPEG image prior to compression, the corner cases have to be handled.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
    <tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173" title="Unknown subsampling.">TJSAMP_UNKNOWN</a> is treated like <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>, since a buffer large enough to hold a JPEG image with no subsampling should also be large enough to hold a JPEG image with an arbitrary level of subsampling. Note that lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the maximum size of the buffer (in bytes) required to hold the image, or 0 if the arguments are out of bounds. </dd></dl>

</div>
</div>
<a id="ga1f03c26892a26d4ce077ed6a4ac40e8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f03c26892a26d4ce077ed6a4ac40e8f">&#9670;&nbsp;</a></span>tj3LoadImage12()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT short* tj3LoadImage12 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Load a 12-bit-per-sample packed-pixel image from disk into memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">filename</td><td>name of a file containing a packed-pixel image in Windows BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require 8-bit-per-sample data precision. If the data precision of the PBMPLUS file does not match the target data precision, then upconverting or downconverting will be performed.</td></tr>
    <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
    <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
<li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The packed-pixel buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the packed-pixel image, converted to the chosen pixel format and with the chosen row alignment, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a>. </dd></dl>

</div>
</div>
<a id="ga638aeba63e0ccb89d472fdbf34224cfc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga638aeba63e0ccb89d472fdbf34224cfc">&#9670;&nbsp;</a></span>tj3LoadImage16()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT unsigned short* tj3LoadImage16 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Load a 16-bit-per-sample packed-pixel image from disk into memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">filename</td><td>name of a file containing a packed-pixel image in Windows BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require 8-bit-per-sample data precision. If the data precision of the PBMPLUS file does not match the target data precision, then upconverting or downconverting will be performed.</td></tr>
    <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
    <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
<li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The packed-pixel buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the packed-pixel image, converted to the chosen pixel format and with the chosen row alignment, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a>. </dd></dl>

</div>
</div>
<a id="ga565aaae7be3f8ca9099b56655c893251"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga565aaae7be3f8ca9099b56655c893251">&#9670;&nbsp;</a></span>tj3LoadImage8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT unsigned char* tj3LoadImage8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Load an 8-bit-per-sample packed-pixel image from disk into memory. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">filename</td><td>name of a file containing a packed-pixel image in Windows BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require 8-bit-per-sample data precision. If the data precision of the PBMPLUS file does not match the target data precision, then upconverting or downconverting will be performed.</td></tr>
    <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
    <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
<li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
<li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The packed-pixel buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the packed-pixel image, converted to the chosen pixel format and with the chosen row alignment, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a>. </dd></dl>

</div>
</div>
<a id="ga7c64b5106d04267a46aad85f9714ad90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7c64b5106d04267a46aad85f9714ad90">&#9670;&nbsp;</a></span>tj3SaveImage12()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3SaveImage12 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const short *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Save a 12-bit-per-sample packed-pixel image from memory to disk. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">filename</td><td>name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.</td></tr>
    <tr><td class="paramname">buffer</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the packed-pixel image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, then the CMYK pixels will be converted to RGB using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="ga0fd87851f4266aca24bf4594dd0c0e71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0fd87851f4266aca24bf4594dd0c0e71">&#9670;&nbsp;</a></span>tj3SaveImage16()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3SaveImage16 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned short *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Save a 16-bit-per-sample packed-pixel image from memory to disk. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">filename</td><td>name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.</td></tr>
    <tr><td class="paramname">buffer</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the packed-pixel image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, then the CMYK pixels will be converted to RGB using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="gaa4ec838988e469cc15618e4690cc8722"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa4ec838988e469cc15618e4690cc8722">&#9670;&nbsp;</a></span>tj3SaveImage8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3SaveImage8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pitch</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>pixelFormat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Save an 8-bit-per-sample packed-pixel image from memory to disk. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">filename</td><td>name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.</td></tr>
    <tr><td class="paramname">buffer</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pitch</td><td>samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the packed-pixel image</td></tr>
    <tr><td class="paramname">pixelFormat</td><td>pixel format of the packed-pixel image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, then the CMYK pixels will be converted to RGB using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="gaddf92640bfee3e8622218c713e77e7db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaddf92640bfee3e8622218c713e77e7db">&#9670;&nbsp;</a></span>tj3Set()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Set </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>param</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the value of a parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
    <tr><td class="paramname">param</td><td>one of the <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a></td></tr>
    <tr><td class="paramname">value</td><td>value of the parameter (refer to <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameter documentation</a>)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="gaa49c7bd4c9431667a043cfc93388ba1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa49c7bd4c9431667a043cfc93388ba1c">&#9670;&nbsp;</a></span>tj3SetCroppingRegion()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3SetCroppingRegion </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structtjregion.html">tjregion</a>&#160;</td>
          <td class="paramname"><em>croppingRegion</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">croppingRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure that specifies a subregion of the JPEG image to decompress, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf" title="A tjregion structure that specifies no cropping.">TJUNCROPPED</a></code> for no cropping. The left boundary of the cropping region must be evenly divisible by the scaled MCU block width (<code><a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED</a>(<a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>[subsamp], scalingFactor)</code>, where <code>subsamp</code> is the level of chrominance subsampling in the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>) and <code>scalingFactor</code> is the decompression scaling factor (see <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>.) The cropping region should be specified relative to the scaled image dimensions. Unless <code>croppingRegion</code> is <code><a class="el" href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf" title="A tjregion structure that specifies no cropping.">TJUNCROPPED</a></code>, the JPEG header must be read (see <a class="el" href="group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1" title="Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quan...">tj3DecompressHeader()</a>) prior to calling this function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="ga89da17ee1e43ff423382cbc145803c75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga89da17ee1e43ff423382cbc145803c75">&#9670;&nbsp;</a></span>tj3SetScalingFactor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3SetScalingFactor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>&#160;</td>
          <td class="paramname"><em>scalingFactor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the scaling factor for subsequent lossy decompression operations. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
    <tr><td class="paramname">scalingFactor</td><td><a class="el" href="structtjscalingfactor.html" title="Scaling factor.">tjscalingfactor</a> structure that specifies a fractional scaling factor that the decompressor supports (see <a class="el" href="group___turbo_j_p_e_g.html#ga74397f8e0587d4233182c72f085aaf04" title="Returns a list of fractional scaling factors that the JPEG decompressor supports.">tj3GetScalingFactors()</a>), or <code><a class="el" href="group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19" title="A tjscalingfactor structure that specifies a scaling factor of 1/1 (no scaling)">TJUNSCALED</a></code> for no scaling. Decompression scaling is a function of the IDCT algorithm, so scaling factors are generally limited to multiples of 1/8. If the entire JPEG image will be decompressed, then the width and height of the scaled destination image can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG width and height (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a> and <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>) and the specified scaling factor. When decompressing into a planar YUV image, an intermediate buffer copy will be performed if the width or height of the scaled destination image is not an even multiple of the MCU block size (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) Note that decompression scaling is not available (and the specified scaling factor is ignored) when decompressing lossless JPEG images (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" title="Lossless JPEG.">TJPARAM_LOSSLESS</a>), since the IDCT algorithm is not used with those images. Note also that <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627" title="DCT/IDCT algorithm [lossy compression and decompression].">TJPARAM_FASTDCT</a> is ignored when decompression scaling is enabled.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>

</div>
</div>
<a id="gaff23ba1dcabed456794b844791613920"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff23ba1dcabed456794b844791613920">&#9670;&nbsp;</a></span>tj3Transform()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3Transform </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
          <td class="paramname"><em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>jpegBuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>jpegSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char **&#160;</td>
          <td class="paramname"><em>dstBufs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>dstSizes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structtjtransform.html">tjtransform</a> *&#160;</td>
          <td class="paramname"><em>transforms</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Losslessly transform a JPEG image into another JPEG image. </p>
<p>Lossless transforms work by moving the raw DCT coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing entropy decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for lossless transformation</td></tr>
    <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG source image to transform</td></tr>
    <tr><td class="paramname">jpegSize</td><td>size of the JPEG source image (in bytes)</td></tr>
    <tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate</td></tr>
    <tr><td class="paramname">dstBufs</td><td>pointer to an array of n byte buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG destination buffer to accommodate the size of the transformed JPEG image. Thus, you can choose to:<ol type="1">
<li>pre-allocate the JPEG destination buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
<li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> with the transformed or cropped width and height and the level of subsampling used in the source image. Under normal circumstances, this should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.) Note, however, that there are some rare cases (such as transforming images with a large amount of embedded EXIF or ICC profile data) in which the transformed JPEG image will be larger than the worst-case size, and <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> cannot be used in those cases.</li>
</ol>
If you choose option 1, then <code>dstSizes[i]</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr>
    <tr><td class="paramname">dstSizes</td><td>pointer to an array of n size_t variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the transformed JPEG image (in bytes.)</td></tr>
    <tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed JPEG image.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>

</div>
</div>
<a id="gaaebaa16973a0f550a66eca5765ed0546"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaebaa16973a0f550a66eca5765ed0546">&#9670;&nbsp;</a></span>tj3YUVBufSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT size_t tj3YUVBufSize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>align</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>subsamp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The size of the buffer (in bytes) required to hold a unified planar YUV image with the given parameters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
    <tr><td class="paramname">align</td><td>row alignment (in bytes) of the image (must be a power of 2.) Setting this parameter to n specifies that each row in each plane of the image will be padded to the nearest multiple of n bytes (1 = unpadded.)</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
    <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the image, or 0 if the arguments are out of bounds. </dd></dl>

</div>
</div>
<a id="ga969767ec8180cc3edd99cf507f87299b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga969767ec8180cc3edd99cf507f87299b">&#9670;&nbsp;</a></span>tj3YUVPlaneHeight()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3YUVPlaneHeight </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>componentID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>subsamp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The plane height of a YUV image plane with the given parameters. </p>
<p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane height.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the YUV image</td></tr>
    <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the plane height of a YUV image plane with the given parameters, or 0 if the arguments are out of bounds. </dd></dl>

</div>
</div>
<a id="gacc19d265edce76b46146f59579f9438d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacc19d265edce76b46146f59579f9438d">&#9670;&nbsp;</a></span>tj3YUVPlaneSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT size_t tj3YUVPlaneSize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>componentID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stride</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>subsamp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the YUV image. NOTE: this is the width of the whole image, not the plane width.</td></tr>
    <tr><td class="paramname">stride</td><td>bytes per row in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>
    <tr><td class="paramname">height</td><td>height (in pixels) of the YUV image. NOTE: this is the height of the whole image, not the plane height.</td></tr>
    <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the YUV image plane, or 0 if the arguments are out of bounds. </dd></dl>

</div>
</div>
<a id="gac99d1933ede1d59fcada9a826e88eb2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac99d1933ede1d59fcada9a826e88eb2d">&#9670;&nbsp;</a></span>tj3YUVPlaneWidth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DLLEXPORT int tj3YUVPlaneWidth </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>componentID</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>subsamp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The plane width of a YUV image plane with the given parameters. </p>
<p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane width.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
    <tr><td class="paramname">width</td><td>width (in pixels) of the YUV image</td></tr>
    <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the plane width of a YUV image plane with the given parameters, or 0 if the arguments are out of bounds. </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="ga5af0ab065feefd526debf1e20c43e837"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5af0ab065feefd526debf1e20c43e837">&#9670;&nbsp;</a></span>tjAlphaOffset</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjAlphaOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Alpha offset (in samples) for a given pixel format. </p>
<p>This specifies the number of samples that the alpha component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRA is stored in <code>unsigned char pixel[]</code>, then the alpha component will be <code>pixel[tjAlphaOffset[TJPF_BGRA]]</code>. This will be -1 if the pixel format does not have an alpha component. </p>

</div>
</div>
<a id="ga84e2e35d3f08025f976ec1ec53693dea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga84e2e35d3f08025f976ec1ec53693dea">&#9670;&nbsp;</a></span>tjBlueOffset</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjBlueOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Blue offset (in samples) for a given pixel format. </p>
<p>This specifies the number of samples that the blue component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the blue component will be <code>pixel[tjBlueOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a blue component. </p>

</div>
</div>
<a id="ga82d6e35da441112a411da41923c0ba2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga82d6e35da441112a411da41923c0ba2f">&#9670;&nbsp;</a></span>tjGreenOffset</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjGreenOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Green offset (in samples) for a given pixel format. </p>
<p>This specifies the number of samples that the green component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the green component will be <code>pixel[tjGreenOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a green component. </p>

</div>
</div>
<a id="gabd247bb9fecb393eca57366feb8327bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabd247bb9fecb393eca57366feb8327bf">&#9670;&nbsp;</a></span>tjMCUHeight</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjMCUHeight[<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>MCU block height (in pixels) for a given level of chrominance subsampling. </p>
<p>MCU block sizes:</p><ul>
<li>8x8 for no subsampling or grayscale</li>
<li>16x8 for 4:2:2</li>
<li>8x16 for 4:4:0</li>
<li>16x16 for 4:2:0</li>
<li>32x8 for 4:1:1</li>
<li>8x32 for 4:4:1 </li>
</ul>

</div>
</div>
<a id="ga9e61e7cd47a15a173283ba94e781308c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9e61e7cd47a15a173283ba94e781308c">&#9670;&nbsp;</a></span>tjMCUWidth</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjMCUWidth[<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>MCU block width (in pixels) for a given level of chrominance subsampling. </p>
<p>MCU block sizes:</p><ul>
<li>8x8 for no subsampling or grayscale</li>
<li>16x8 for 4:2:2</li>
<li>8x16 for 4:4:0</li>
<li>16x16 for 4:2:0</li>
<li>32x8 for 4:1:1</li>
<li>8x32 for 4:4:1 </li>
</ul>

</div>
</div>
<a id="gad77cf8fe5b2bfd3cb3f53098146abb4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad77cf8fe5b2bfd3cb3f53098146abb4c">&#9670;&nbsp;</a></span>tjPixelSize</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjPixelSize[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Pixel size (in samples) for a given pixel format. </p>

</div>
</div>
<a id="gadd9b446742ac8a3923f7992c7988fea8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadd9b446742ac8a3923f7992c7988fea8">&#9670;&nbsp;</a></span>tjRedOffset</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const int tjRedOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Red offset (in samples) for a given pixel format. </p>
<p>This specifies the number of samples that the red component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the red component will be <code>pixel[tjRedOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a red component. </p>

</div>
</div>
<a id="ga6f192ad58a5a5802e145149d83c643bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6f192ad58a5a5802e145149d83c643bf">&#9670;&nbsp;</a></span>TJUNCROPPED</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structtjregion.html">tjregion</a> TJUNCROPPED</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>A <a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure that specifies no cropping. </p>

</div>
</div>
<a id="ga7880644a0849161ad20933536169ee19"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7880644a0849161ad20933536169ee19">&#9670;&nbsp;</a></span>TJUNSCALED</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> TJUNSCALED</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>A <a class="el" href="structtjscalingfactor.html" title="Scaling factor.">tjscalingfactor</a> structure that specifies a scaling factor of 1/1 (no scaling) </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
